<template>
	<view>
		<view>
			<view class="content_search  u-border-bottom">
				<view>
					<u-search disabled @click="toSearchFriends"  bg-color="#ffffff" margin="2rpx 10rpx"  :show-action="false" shape="square" placeholder="帐号/手机号" v-model="keyword"></u-search>
					<!-- vuex_userInfo.chatNumber -->
					<view style="text-align: center;margin-top: 10rpx;font-weight: 400;">我的账号: {{vuex_userInfo.mobile}}</view>
				</view>
			</view>
			
			<view>
				<u-cell-group>
					 <u-cell-item title="手机联系人" label="添加通讯录中的朋友" @click="getPhoneContact">
						 <view slot="icon" class="u-flex u-row-center" style="background-color: #19be6b;width: 70rpx;height: 70rpx;margin-right: 24rpx;">
							 <u-icon :name="require('@/static/image/contact.png')" color="#ffffff" size="36"></u-icon>
						 </view>
					 </u-cell-item>
				</u-cell-group>
			</view>
		</view>
	</view>
</template>

<script>
	import searchInput from '@/components/searchInput/index.vue';
	import permission from '@/common/mobilePermission/permission.js';
	export default {
		components:{searchInput},
		data() {
			return {
				keyword:''
			};
		},
		methods:{
			getPhoneContact:function(){
				//请求获取相关权限
				if (uni.getSystemInfoSync().platform == "android") {
				  permission.requestAndroid("android.permission.READ_CONTACTS");//录音
				}else{
				  permission.requestIOS("contact");//ios请求录音权限
				}
				this.$u.route("/pages/chat/friends/phoneContacts");
			},
			toSearchFriends:function(){
				this.$u.route("/pages/search/searchFriends");
			}
		}
	}
</script>

<style lang="scss" scoped>
.content_search {
	padding: 16rpx;
	background-color: #f8f8f8;
}
</style>
